package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;

/**
 * 林地指标表 实体类。
 *
 * @author 11987
 * @since 2025-04-16
 */
@Table(value = "LINDI_INDEX", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiIndex extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 指标ID
     */
    private Long indexId;

    /**
     * 镇街名称
     */
    private String locationName;

    /**
     * 购入指标
     */
    private String purchaseIndex;

    /**
     * 交易指标
     */
    private String tradeIndex;

    // 无参构造函数
    public LindiIndex() {
    }

    // 全参构造函数
    public LindiIndex(Long indexId, String locationName, String purchaseIndex, String tradeIndex) {
        this.indexId = indexId;
        this.locationName = locationName;
        this.purchaseIndex = purchaseIndex;
        this.tradeIndex = tradeIndex;
    }

    // Getter和Setter方法
    public Long getIndexId() {
        return indexId;
    }

    public void setIndexId(Long indexId) {
        this.indexId = indexId;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getPurchaseIndex() {
        return purchaseIndex;
    }

    public void setPurchaseIndex(String purchaseIndex) {
        this.purchaseIndex = purchaseIndex;
    }

    public String getTradeIndex() {
        return tradeIndex;
    }

    public void setTradeIndex(String tradeIndex) {
        this.tradeIndex = tradeIndex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiIndex that = (LindiIndex) o;
        return java.util.Objects.equals(indexId, that.indexId) &&
               java.util.Objects.equals(locationName, that.locationName) &&
               java.util.Objects.equals(purchaseIndex, that.purchaseIndex) &&
               java.util.Objects.equals(tradeIndex, that.tradeIndex);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(super.hashCode(), indexId, locationName, purchaseIndex, tradeIndex);
    }

    @Override
    public String toString() {
        return "LindiIndex{" +
               "indexId=" + indexId +
               ", locationName='" + locationName + '\'' +
               ", purchaseIndex='" + purchaseIndex + '\'' +
               ", tradeIndex='" + tradeIndex + '\'' +
               "} " + super.toString();
    }

    // Builder类
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long indexId;
        private String locationName;
        private String purchaseIndex;
        private String tradeIndex;

        public Builder indexId(Long indexId) {
            this.indexId = indexId;
            return this;
        }

        public Builder locationName(String locationName) {
            this.locationName = locationName;
            return this;
        }

        public Builder purchaseIndex(String purchaseIndex) {
            this.purchaseIndex = purchaseIndex;
            return this;
        }

        public Builder tradeIndex(String tradeIndex) {
            this.tradeIndex = tradeIndex;
            return this;
        }

        public LindiIndex build() {
            return new LindiIndex(indexId, locationName, purchaseIndex, tradeIndex);
        }
    }

}
